package net.bwie.realtime.jtp.common.utils;

import org.apache.doris.flink.cfg.DorisSink;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.doris.flink.cfg.DorisOptions;
import org.apache.flink.streaming.api.functions.sink.SinkFunction;

public class DorisUtil {
    public static void saveToDoris(DataStream<String> stream,String database,String table) {
        DorisOptions options = new DorisOptions.Builder()
                .setFenodes("node102:8030")
                .setTableIdentifier(database + "." + table)
                .setUsername("root")
                .setPassword("123456")
                .build();
        SinkFunction<String> sink = DorisSink.<String>sink(options);
        stream.addSink(sink);

    }
}
